package com.david.course_design.shopping_center.module.goods.goodsLunBoTuImageList.service.impl;

import com.david.course_design.shopping_center.module.goods.goodsLunBoTuImageList.entity.GoodsLunBoTuImageList;
import com.david.course_design.shopping_center.module.goods.goodsLunBoTuImageList.mapper.GoodsLunBoTuImageListMapper;
import com.david.course_design.shopping_center.module.goods.goodsLunBoTuImageList.service.GoodsLunBoTuImageListService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GoodsLunBoTuImageListServiceImpl implements GoodsLunBoTuImageListService {
    // 依赖注入 dependency injection 
    @Resource
    private GoodsLunBoTuImageListMapper goodsLunBoTuImageListMapper;

    /**
     * 通过 轮播图集合id（LunBoTuListId） 查询 商品轮播图 图片集合
     *
     * @param id 轮播图集合id
     * @return 查询到的轮播图图片集合
     */
    @Override
    public List<GoodsLunBoTuImageList> selectGoodsLunBoTuImageListByLunBoTuListId(Integer id) {

        List<GoodsLunBoTuImageList> goodsLunBoTuImageLists = goodsLunBoTuImageListMapper.selectGoodsLunBoTuImageListByLunBoTuListId(id);

        if (goodsLunBoTuImageLists != null || goodsLunBoTuImageLists.size() != 0) {

            System.out.println(goodsLunBoTuImageLists);
            System.out.println();

            return goodsLunBoTuImageLists;

        }

        return null;

    }

}
